﻿using Microsoft.Extensions.DependencyInjection;
using MyExtension.AutoMapper;

namespace MyExtension.ServiceExtensions
{
    public static class AutoMapperSetup
    {
        /// <summary>
        /// AutoMapper 相关配置
        /// </summary>
        /// <param name="services"></param>
        /// <exception cref="ArgumentNullException"></exception>
        public static void AddAutoMapperSetup(this IServiceCollection services) { 
            if (services == null) throw new ArgumentNullException(nameof(services));

            services.AddAutoMapper(typeof(AutoMapperConfig));
        }
    }
}
